package com.sankei.rocketmq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * Classname: ConsumerService
 * Description:
 *
 * @Author: dxy
 * @Create: 2025/2/7-19:37
 * @Version: v1.0
 */
@RocketMQMessageListener(topic = "java-rocketmq",consumerGroup = "${rocketmq.consumer.group}")
@Component("consumerService")
public class ConsumerService implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        System.out.println("收到消息: " + s);
    }
}
